(function ($) {
	$(document).ready(function() {
		// 兼容IE6
	    if ($.isFunction($.bootstrapIE6)) {
	    	$.bootstrapIE6($(document));
	    }
	    
	    // 外链用新窗口打开
	    $("a[href^='http://']").attr({'target':'_blank'});
	    
	    // 图片懒加载
	    $("img.lazy").unveil();
	    
	    // 回到顶部效果
		$.scrollUp({
	          scrollName: 'scrollUp', // Element ID
	          topDistance: '300', // Distance from top before showing element (px)
	          topSpeed: 500, // Speed back to top (ms)
	          animation: 'fade', // Fade, slide, none
	          animationInSpeed: 200, // Animation in speed (ms)
	          animationOutSpeed: 200, // Animation out speed (ms)
	          scrollText: '', // Text for element
	          activeOverlay: false  // Set CSS color to display scrollUp active point, e.g '#00FFFF'
		});
		
		// 侧边栏效果
		$(function() {
			$('#side-nav').css('top', Math.max(100, ($(window).height()-$('#side-nav').height())/2));
			$(window).resize(function(){
				$('#side-nav').css('top', Math.max(100, ($(window).height()-$('#side-nav').height())/2));
			});
			$('#side-nav a').css('marginLeft', '-85px');
			$('#side-nav').show();
			$('#side-nav > li').hover(function() {
				$('a', $(this)).stop().animate({
					'marginLeft' : '-2px'
				}, 200);
			}, function() {
				$('a', $(this)).stop().animate({
					'marginLeft' : '-85px'
				}, 200);
			});
		});
	});
})(jQuery);